/**
 * related to repairApply.ui
 * 
 * @Author : 2037630@163.com
 * @Timestamp : 2017-04-19
 */
var notify = sm("do_Notification");
var page = sm("do_Page");
var Controller = require("core/controller");
var constant = require('config/constant');
var log = require("util/log")
var navigate = require("util/navigate")
var router = require("config/router")
var net = require('util/net')
var server = require('config/server')
var deviceMou=require("module/deviceModule")
Controller({
	config:{
		name : "repairApply",
		header:{
			title:"修复申请",
			right:{
				text:"提交",
				handle:function(){
					log.info(22222222,this.data.rp_applyCont)
					if (this.data.rp_applyCont.length>=5) {
						net.send({
							server : server.organization.saveRepayApply,
							data:{
								cupoId: this.data.rpApply,
								orapRemark: this.data.rp_applyCont
							},
							success : function() {
								log.info("success")
								notify.toast("提交成功")
								navigate.back("6666")
							},
							error : function(data) {
								notify.toast(data.reason)
							},
							scope:this
						})
					}else {
						deviceMou.isIOS===true?notify.toast('申请内容不得少于5个字', 150, 850):notify.toast('申请内容不得少于5个字')
					}
					
				}
			}
		}
	},
	ui:{
		rp_applyCont:"rp_applyCont"
	},
	mapping: {
		"rp_applyCont.text":"rp_applyCont",
	},
	data:{
		rp_applyCont:""
		},
	event:{

	},
	loaded: function(data){
		this.data.rpApply=data
		log.info(566,data)
	}
	
})